<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="ww" uri="webwork" %>
<ww:bean name="'com.css.apps.base.user.service.UserService'" id="userService" />
<form class="form-horizontal form-validate" id="SortUser_form" method="post" action="updUserOrder.action"  onsubmit="return $action.submit(this);">
	<input type="hidden" id="userId" name="userId" value="<ww:property value='userId'/>"/>
	<input type="hidden" id="deptId" name="deptId" value="<ww:property value='deptId'/>"/>
	<div class="control-group">
		<label class="control-label" >排序号</label>
		<div class="controls">
			<input type="text" placeholder="请输入排序号"  onkeyup="checkVal(this.value)" class="input-large required"  id="orderNum" name="orderNum" value="<ww:property value='#userService.toSimpleNum(orderNum)'/>"/>
			<div id="alertArea" style="color:red;position: relative;"></div>
		</div>
	</div>
	<div class="set-btn" data-spy="affix" data-offset-top="200">
		<a class="save btn" href="javascript:;" onclick="submit(this);" style="border: 0;background-color: #317caf;height: 21px;width: 26px">保存</a>
	</div>
</form>
<script>
    function checkVal(orderNum){
        var regex = /^[1-9]\d{0,3}$/;
        if(regex.test(orderNum)){
            $("#alertArea",$css.focusDialog()).html("");
			return true;
		}else{
            $("#alertArea",$css.focusDialog()).html("排序号必须为数字，且1<=排序号<=9999");
            return false;
		}
    }

    function submit(el) {
        if(checkVal($("#orderNum",$css.focusDialog()).val())){
            $(el).submit();
		}
    }
</script>
